Skip to content

fix(cmd): add --user flag to agent chat for user_id authentication#714

Open
stanleykao72 wants to merge 1 commit intonextlevelbuilder:mainfrom
stanleykao72:fix/cli-chat-user-id
Open

fix(cmd): add --user flag to agent chat for user_id authentication#714
stanleykao72 wants to merge 1 commit intonextlevelbuilder:mainfrom
stanleykao72:fix/cli-chat-user-id

Conversation

@stanleykao72
Copy link
Copy Markdown

Summary

  • goclaw agent chat never sends user_id in the WebSocket connect frame
  • Gateway requires user_id for chat.send, so the CLI always fails with user_id is required
  • All other clients (browser, Telegram, LINE, Discord, Slack) send user_id during connect — CLI is the only channel missing it

Changes

  • cmd/agent_chat.go: Add --user / -u flag
  • cmd/agent_chat_client.go: Pass user_id in connect params

Usage

# Before: always fails
goclaw agent chat --name my-agent -m "hello"
# Error: agent error: user_id is required

# After: works
goclaw agent chat --name my-agent --user stanley -m "hello"

Test plan

  • goclaw agent chat --name default --user testuser -m "hello" → agent responds (no user_id is required error)
  • goclaw agent chat --name default -m "hello" (no --user) → still fails with user_id is required (backward compatible, no silent default)
  • Interactive REPL mode with --user flag → works across multiple messages in same session

🤖 Generated with Claude Code

The CLI agent chat command connects via WebSocket but never sends
user_id in the connect params. The gateway requires user_id for
chat.send, making the CLI unusable for any agent interaction.

All other clients (browser, Telegram, LINE, etc.) send user_id
during connect. The CLI was the only channel missing it.

Adds --user / -u flag that passes user_id in the connect frame.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant